package com.easy.service.impl;

import com.easy.bean.Product;
import com.easy.dao.ProductDao;
import com.easy.service.IProductService;
import com.easy.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class ProductService implements IProductService {
    @Autowired
    ProductDao productDao;

    @Override
    public int addProduct(Product product) {
        return productDao.addProduct(product);
    }

    @Override
    public int editProduct(Product product) {
        return productDao.editProduct(product);
    }

    @Override
    public int deleteProduct(int proid) {
        return productDao.deleteProduct(proid);
    }

    @Override
    public List<Product> selectProduct(Page page, String text) {
        return productDao.selectProduct(page,text);
    }


    @Override
    public Product getProductById(int proid) {
        return productDao.getProductById(proid);
    }

    @Override
    public int ProductCount(String text) {
        return productDao.ProductCount(text);
    }
}
